﻿Shader "Custom/testOverlay" {
// simple unlit shader
    Properties {
      _MainTex ("Texture", 2D) = "white" {}
      _MaskMap ("Mask", 2D) = "mask" {}
      _Detail ("Detail", 2D) = "gray" {}
    }
    SubShader {
      Tags { "RenderType" = "Opaque" }
      CGPROGRAM
      #pragma surface surf NoLighting
      struct Input {
          float2 uv_MainTex;
          float2 uv_MaskMap;
          float2 uv_Detail;
      };
      
           fixed4 LightingNoLighting(SurfaceOutput s, fixed3 lightDir, fixed atten)
	    {
	    fixed4 c;
	    c.rgb = s.Albedo;
	    c.a = s.Alpha;
	    return c;
	    }
    
      sampler2D _MainTex;
      sampler2D _MaskMap;
      sampler2D _Detail;
      void surf (Input IN, inout SurfaceOutput o) {
          o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
          o.Albedo += (tex2D (_MaskMap, IN.uv_MaskMap).rgb * tex2D (_Detail, IN.uv_Detail).rgb);
          //o.Albedo *= tex2D (_Detail, IN.uv_Detail).rgb * 2;
      }
      ENDCG
    } 
    Fallback "Diffuse"
  }